package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysOrderConfMapper;
import com.ruoyi.system.domain.SysOrderConf;
import com.ruoyi.system.service.ISysOrderConfService;
import com.ruoyi.common.core.text.Convert;

/**
 * 订单配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-20
 */
@Service
public class SysOrderConfServiceImpl implements ISysOrderConfService 
{
    @Autowired
    private SysOrderConfMapper sysOrderConfMapper;

    /**
     * 查询订单配置
     * 
     * @param id 订单配置主键
     * @return 订单配置
     */
    @Override
    public SysOrderConf selectSysOrderConfById(Long id)
    {
        return sysOrderConfMapper.selectSysOrderConfById(id);
    }

    /**
     * 查询订单配置列表
     * 
     * @param sysOrderConf 订单配置
     * @return 订单配置
     */
    @Override
    public List<SysOrderConf> selectSysOrderConfList(SysOrderConf sysOrderConf)
    {
        return sysOrderConfMapper.selectSysOrderConfList(sysOrderConf);
    }

    /**
     * 新增订单配置
     * 
     * @param sysOrderConf 订单配置
     * @return 结果
     */
    @Override
    public int insertSysOrderConf(SysOrderConf sysOrderConf)
    {
        sysOrderConf.setCreateTime(DateUtils.getNowDate());
        return sysOrderConfMapper.insertSysOrderConf(sysOrderConf);
    }

    /**
     * 修改订单配置
     * 
     * @param sysOrderConf 订单配置
     * @return 结果
     */
    @Override
    public int updateSysOrderConf(SysOrderConf sysOrderConf)
    {
        sysOrderConf.setUpdateTime(DateUtils.getNowDate());
        return sysOrderConfMapper.updateSysOrderConf(sysOrderConf);
    }

    /**
     * 批量删除订单配置
     * 
     * @param ids 需要删除的订单配置主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderConfByIds(String ids)
    {
        return sysOrderConfMapper.deleteSysOrderConfByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单配置信息
     * 
     * @param id 订单配置主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderConfById(Long id)
    {
        return sysOrderConfMapper.deleteSysOrderConfById(id);
    }
}
